package com.hkd.common.api.enums;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @author HKD
 * @date 2022/9/17 18:55
 */
@ApiModel("状态")
public enum Status implements Serializable {
//    禁用
    @ApiModelProperty("禁用")
    DISABLE(0),
//    启用
    @ApiModelProperty("启用")
    ENABLE(1)
    ;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    Status(Integer code) {
        this.code = code;
    }
    public static Status search(Integer code){
        Status[] values = values();
        for (Status value : values) {
            if (value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}
